package com.ywjt.platformbusiness.my.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.my.model.IntegralModel;

import java.util.List;

public class IntegralAdapter extends BaseQuickAdapter<IntegralModel.ResultDTO.IntegralFlowListDTO, BaseViewHolder> {

    public IntegralAdapter(@Nullable List<IntegralModel.ResultDTO.IntegralFlowListDTO> data) {
        super(R.layout.item_mybalance, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, IntegralModel.ResultDTO.IntegralFlowListDTO  item) {

//item.type  0 注册 1签到 2消费
        switch (item.getType()){
            case 0:
                helper.setText(R.id.tvTitle,"注册成功");
                helper.setText(R.id.tvCreateTime,"注册时间"+item.getCreateTime());
                break;
            case 1:
                helper.setText(R.id.tvTitle,"签到成功");
                helper.setText(R.id.tvCreateTime,"签到时间"+item.getCreateTime());
                break;
            case 2:
                helper.setText(R.id.tvTitle,"消费成功");
                helper.setText(R.id.tvCreateTime,"消费时间"+item.getCreateTime());
                break;
        }

        helper.setText(R.id.tvIntegral,"+"+item.getAmount());
    }
}
